package com.iplant.basic.service;

import java.util.List;
import java.util.Map;

import com.iplant.base.po.EnumItem;
import com.iplant.base.po.Pagination;
import com.iplant.base.po.ServiceResult;
import com.iplant.base.po.excel.ExcelData;
import com.iplant.basic.service.basicenum.bpm.BPMEventModule;
import com.iplant.basic.service.po.bms.*;
import com.iplant.basic.service.po.bms.qft.BMSPersonQualification;

public interface BMSService {

    //region 历史接口
// Function01:User Manager Interface
    ServiceResult<BMSEmployee> BMS_LoginEmployee(String wLoginName, String wPassword, long wMAC);

    ServiceResult<BMSEmployee> BMS_LoginEmployeeByToken(String wLoginName, String wToken);

    ServiceResult<BMSEmployee> BMS_LoginEmployeeByOne(String wLoginID);

    ServiceResult<BMSEmployee> BMS_LoginEmployeeByUserName(String wUserName, String wPassword);

    ServiceResult<List<BMSEmployee>> BMS_QueryEmployeeList(BMSEmployee wLoginUser, int wDepartmentID, int wPosition,
                                                           int wDepartmentType, int wPositionType, int wActive,
                                                           String wName, Pagination wPagination);

    ServiceResult<List<BMSEmployee>> BMS_QueryEmployeeList(BMSEmployee wLoginUser, List<Integer> wID);

    ServiceResult<BMSEmployee> BMS_QueryEmployeeByID(BMSEmployee wLoginUser, int wID);

    ServiceResult<Integer> BMS_AddEmployee(BMSEmployee wLoginUser, BMSEmployee wEmployee);

    ServiceResult<Integer> BMS_SaveEmployee(BMSEmployee wLoginUser, BMSEmployee wEmployee);

    ServiceResult<Integer> BMS_SavePassword(BMSEmployee wLoginUser, BMSEmployee wEmployee);

    ServiceResult<Integer> BMS_DeleteEmployee(BMSEmployee wLoginUser, BMSEmployee wEmployee);

    ServiceResult<Integer> BMS_DisableEmployee(BMSEmployee wLoginUser, BMSEmployee wEmployee);

    ServiceResult<Integer> BMS_ActiveEmployee(BMSEmployee wLoginUser, BMSEmployee wEmployee);

    ServiceResult<Integer> BMS_ResetPassword(BMSEmployee wLoginUser, BMSEmployee wEmployee);

    ServiceResult<BMSRole> BMS_AddRole(BMSEmployee wLoginUser, BMSRole wRole);

    ServiceResult<List<BMSRole>> BMS_GetRoleList(BMSEmployee wLoginUser, List<Integer> wDepartmentID, String wName,
                                                 int wUserID, int wActive, Pagination wPagination);

    ServiceResult<List<BMSRole>> BMS_GetRoleList(BMSEmployee wLoginUser, int wDepartmentID, int wIsTop, String wName,
                                                 int wUserID, int wActive, Pagination wPagination);

    ServiceResult<Integer> BMS_RemoveRole(BMSEmployee wLoginUser, int wID);

    ServiceResult<Integer> BMS_SaveRole(BMSEmployee wLoginUser, BMSRole wRole);

    ServiceResult<Integer> BMS_SaveRoleRangeList(BMSEmployee wLoginUser, int wRoleID, List<BMSRoleItem> wFunctionList);

    ServiceResult<Integer> BMS_SaveRoleFunctionList(BMSEmployee wLoginUser, int wRoleID,
                                                    List<BMSRoleItem> wFunctionList);

    ServiceResult<Integer> BMS_SaveRoleUserList(BMSEmployee wLoginUser, int wRoleID, List<BMSRoleItem> wUserList);

    ServiceResult<List<BMSRoleItem>> BMS_QueryRangeListByRoleID(BMSEmployee wLoginUser, int wRoleID);

    ServiceResult<List<BMSRoleItem>> BMS_QueryRangeListByOperatorID(BMSEmployee wLoginUser, int wOperatorID,
                                                                    int wFunctionID);

    ServiceResult<List<BMSRoleItem>> BMS_QueryFunctionListByRoleID(BMSEmployee wLoginUser, int wRoleID);

    ServiceResult<List<BMSRoleItem>> BMS_QueryUserListByRoleID(BMSEmployee wLoginUser, int wRoleID);

    ServiceResult<Integer> BMS_DisableRole(BMSEmployee wLoginUser, int wID);

    ServiceResult<Integer> BMS_ActiveRole(BMSEmployee wLoginUser, int wID);

    ServiceResult<Integer> BMS_CheckPower(BMSEmployee wLoginUser, int wLoginID, int wAuthorityID, int wRangeID,
                                          int wRangeType);

    ServiceResult<Integer> BMS_CheckPower(BMSEmployee wLoginUser, int wLoginID, String wPath, int wRangeID,
                                          int wRangeType);

    ServiceResult<Integer> BMS_ActiveFunctionNodeTree(BMSEmployee wLoginUser, List<Integer> wFunctionIDList,
                                                      int wActive);

    ServiceResult<Integer> BMS_DeleteFunctionNodeTree(BMSEmployee wLoginUser, List<Integer> wFunctionIDList);

    ServiceResult<BMSRoleItem> BMS_UpdateFunctionNodeTree(BMSEmployee wLoginUser, BMSRoleItem wBMSRoleItem);

    ServiceResult<List<BMSRoleItem>> BMS_GetFunctionNodeTree(BMSEmployee wLoginUser, int wActive);

    ServiceResult<List<BMSRoleItem>> BMS_GetFunctionListByLoginID(BMSEmployee wLoginUser, int wUserID);

    ServiceResult<List<BMSRoleItem>> BMS_QueryUserListByFunctionID(BMSEmployee wLoginUser, int wFunctionID);

    // Function Department&Position
    // Function02:Department Manager Interface
    ServiceResult<Integer> BMS_AddPosition(BMSEmployee wLoginUser, BMSPosition wPosition);

    ServiceResult<Integer> BMS_SavePosition(BMSEmployee wLoginUser, BMSPosition wPosition);

    ServiceResult<Integer> BMS_ActivePositionByID(BMSEmployee wLoginUser, int wID);

    ServiceResult<Integer> BMS_DisablePositionByID(BMSEmployee wLoginUser, int wID);

    ServiceResult<Integer> BMS_DeletePosition(BMSEmployee wLoginUser, BMSPosition wBMSPosition);

    ServiceResult<List<BMSPosition>> BMS_QueryPositionList(BMSEmployee wLoginUser, int wDepartmentID, String wName,
                                                           int wActive, Pagination wPagination);

    ServiceResult<BMSPosition> BMS_QueryPositionByID(BMSEmployee wLoginUser, int wID, String wCode);

    ServiceResult<Integer> BMS_AddDepartment(BMSEmployee wLoginUser, BMSDepartment wDepartment);

    ServiceResult<Integer> BMS_SaveDepartment(BMSEmployee wLoginUser, BMSDepartment wDepartment);

    ServiceResult<Integer> BMS_ActiveDepartmentByID(BMSEmployee wLoginUser, int wID);

    ServiceResult<Integer> BMS_DisableDepartmentByID(BMSEmployee wLoginUser, int wID);

    ServiceResult<Integer> BMS_DeleteDepartment(BMSEmployee wLoginUser, BMSDepartment wDepartment);

    ServiceResult<List<BMSDepartment>> BMS_QueryDepartmentList(BMSEmployee wLoginUser, int wParentID, String wName,
                                                               int wType, int wActive, Pagination wPagination);

    ServiceResult<BMSDepartment> BMS_QueryDepartmentByID(BMSEmployee wLoginUser, int wID, String wCode);

    ServiceResult<List<BMSTeam>> BMS_GetTeamList(BMSEmployee wLoginUser, String wName, int wFactoryID, int wWorkshopID,
                                                 int wDepartmentID, int wModuleID, int wLeaderID, int wActive,
                                                 Pagination wPagination);

    ServiceResult<List<BMSTeam>> BMS_GetTeamList(BMSEmployee wLoginUser, List<Integer> wIDList);

    ServiceResult<BMSTeam> BMS_GetTeam(BMSEmployee wLoginUser, int wID, String wCode);

    ServiceResult<Integer> BMS_UpdateTeam(BMSEmployee wLoginUser, BMSTeam wBMSTeam);

    ServiceResult<Integer> BMS_DeleteTeam(BMSEmployee wLoginUser, BMSTeam wBMSTeam);

    ServiceResult<Integer> BMS_ActiveTeam(BMSEmployee wLoginUser, BMSTeam wBMSTeam, int wActive);

    ServiceResult<List<BMSTeamItem>> BMS_GetTeamItemList(BMSEmployee wLoginUser, String wName, int wFactoryID,
                                                         int wWorkTypeID,
                                                         int wWorkshopID, int wTeamID, int wWorkAreaID,
                                                         int wStationID, String wStationCode, int wActive,
                                                         Pagination wPagination);

    ServiceResult<Integer> BMS_UpdateTeamItem(BMSEmployee wLoginUser, BMSTeamItem wTeamItem);

    ServiceResult<Integer> BMS_ActiveTeamItem(BMSEmployee wLoginUser, BMSTeamItem wBMSTeamItem, int wActive);

    ServiceResult<BMSTeamItem> BMS_QueryTeamItem(BMSEmployee wLoginUser, int wID);

    ServiceResult<Integer> BMS_DeleteTeamItem(BMSEmployee wLoginUser, BMSTeamItem wTeamItem);

    ServiceResult<Integer> BMS_SaveWorkType(BMSEmployee wLoginUser, BMSWorkType wWorkType);

    ServiceResult<Integer> BMS_DeleteWorkType(BMSEmployee wLoginUser, BMSWorkType wWorkType);

    ServiceResult<Integer> BMS_ActiveWorkType(BMSEmployee wLoginUser, BMSWorkType wWorkType, int wActive);

    ServiceResult<List<BMSWorkType>> BMS_QueryWorkTypeList(BMSEmployee wLoginUser, String wName, int wActive,
                                                           Pagination wPagination);

    ServiceResult<BMSWorkType> BMS_QueryWorkType(BMSEmployee wLoginUser, int wID, String wCode);

    ServiceResult<Integer> BMS_UpdateRegion(BMSEmployee wLoginUser, BMSRegion wRegion);

    ServiceResult<Integer> BMS_DeleteRegion(BMSEmployee wLoginUser, BMSRegion wRegion);

    ServiceResult<Integer> BMS_ActiveRegion(BMSEmployee wLoginUser, BMSRegion wRegion, int wActive);

    ServiceResult<BMSRegion> BMS_QueryRegion(BMSEmployee wLoginUser, int wID, String wCode);

    ServiceResult<List<BMSRegion>> BMS_QueryRegionList(BMSEmployee wLoginUser, String wName, int wTypeID, int wParentID,
                                                       String wFullName, int wActive, Pagination wPagination);

    ServiceResult<Integer> BMS_DeleteRole(BMSEmployee wLoginUser, BMSRole wRole);

    ServiceResult<List<EnumItem>> BMS_QueryDepartmentTypeList(BMSEmployee wLoginUser);
    //endregion

    //region 班组管理
    void InitClassInfo(BMSEmployee wLoginUser);

    ServiceResult<Integer> BMS_ImportClassInfo(BMSEmployee wLoginUser, ExcelData wExcelData);

    //endregion

    Map<Integer, Integer> BMS_QueryDepartmentNumMap(BMSEmployee wLoginUser, List<Integer> collect);

    void BMS_UpdateLastOnlineTime(BMSEmployee wBMSEmployee);



    //region 用户管理
    ServiceResult<List<BMSEmployee>> BMS_QueryUserAllByLogin(BMSEmployee wLoginUser);

    ServiceResult<Integer> BMS_ImportUser(BMSEmployee wLoginUser, ExcelData result);

    ServiceResult<Integer> BMS_PasswordModifyNew(BMSEmployee wLoginUser, String wUserAcc, String wPassword, String wOldPassWord);

    ServiceResult<Integer> BMS_ImportUserByClassInfo(BMSEmployee wLoginUser, ExcelData wExcelData);
    //endregion

    //region 部门管理

    ServiceResult<Integer> BMS_ImportDepartment(BMSEmployee wLoginUser, ExcelData wExcelData);
    //endregion

    //region 权限管理
    ServiceResult<Integer> BMS_ImportRole(BMSEmployee wLoginUser, ExcelData wExcelData);

    ServiceResult<Integer> BMS_DeleteFunctionNodeTree_V1(BMSEmployee wBMSEmployee, List<Integer> wFunctionIDList);
    //endregion
}
